/**
 *
 */
import Util;
import OpenApi;
import OpenApiUtil;
import EndpointUtil;

extends OpenApi;


init(config: OpenApi.Config){
  super(config);
  @endpointRule = 'regional';
  @endpointMap = {
    cn-beijing = 'webplus.cn-hangzhou.aliyuncs.com',
    cn-zhangjiakou = 'webplus.cn-hangzhou.aliyuncs.com',
    cn-shanghai = 'webplus.cn-hangzhou.aliyuncs.com',
    cn-shenzhen = 'webplus.cn-hangzhou.aliyuncs.com',
    ap-northeast-1 = 'webplus.aliyuncs.com',
    ap-south-1 = 'webplus.aliyuncs.com',
    ap-southeast-1 = 'webplus.aliyuncs.com',
    ap-southeast-2 = 'webplus.aliyuncs.com',
    ap-southeast-3 = 'webplus.aliyuncs.com',
    ap-southeast-5 = 'webplus.aliyuncs.com',
    cn-chengdu = 'webplus.aliyuncs.com',
    cn-hongkong = 'webplus-vpc.cn-hongkong.aliyuncs.com',
    cn-huhehaote = 'webplus.aliyuncs.com',
    cn-qingdao = 'webplus.aliyuncs.com',
    eu-central-1 = 'webplus.aliyuncs.com',
    eu-west-1 = 'webplus.aliyuncs.com',
    me-east-1 = 'webplus.aliyuncs.com',
    us-east-1 = 'webplus.aliyuncs.com',
    us-west-1 = 'webplus.aliyuncs.com',
    cn-hangzhou-finance = 'webplus.aliyuncs.com',
    cn-shenzhen-finance-1 = 'webplus.aliyuncs.com',
    cn-shanghai-finance-1 = 'webplus.aliyuncs.com',
    cn-north-2-gov-1 = 'webplus.aliyuncs.com',
  };

  checkConfig(config);
  @endpoint = getEndpoint('webplus', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!Util.empty(endpoint)) {
    return endpoint;
  }
  
  if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model AbortChangeRequest {
  changeId?: string(name='ChangeId'),
  regionId?: string(name='RegionId'),
}

model AbortChangeResponseBody = {
  code?: string(name='Code'),
  envChange?: {
    changeId?: string(name='ChangeId'),
    envId?: string(name='EnvId'),
    startTime?: string(name='StartTime'),
  }(name='EnvChange'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
}

model AbortChangeResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: AbortChangeResponseBody(name='body'),
}

async function abortChange(request: AbortChangeRequest): AbortChangeResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return abortChangeWithOptions(request, headers, runtime);
}

async function abortChangeWithOptions(request: AbortChangeRequest, headers: map[string]string, runtime: Util.RuntimeOptions): AbortChangeResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }

  var body : map[string]any = {};
  if (!Util.isUnset(request.changeId)) {
    body['ChangeId'] = request.changeId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'AbortChange',
    version = '2019-03-20',
    protocol = 'HTTPS',
    pathname = `/pop/v1/wam/change/abort`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

model CreateAppEnvRequest {
  appId?: string(name='AppId'),
  dryRun?: boolean(name='DryRun'),
  envDescription?: string(name='EnvDescription'),
  envName?: string(name='EnvName'),
  extraProperties?: string(name='ExtraProperties'),
  optionSettings?: string(name='OptionSettings'),
  pkgVersionId?: string(name='PkgVersionId'),
  profileName?: string(name='ProfileName'),
  regionId?: string(name='RegionId'),
  sourceEnvId?: string(name='SourceEnvId'),
  stackId?: string(name='StackId'),
  templateId?: string(name='TemplateId'),
}

model CreateAppEnvResponseBody = {
  code?: string(name='Code'),
  envChangeDetail?: {
    changeId?: string(name='ChangeId'),
    envId?: string(name='EnvId'),
    operations?: {
      operation?: [ 
      {
        operationDescription?: string(name='OperationDescription'),
        operationType?: string(name='OperationType'),
      }
    ](name='Operation')
    }(name='Operations'),
    startTime?: string(name='StartTime'),
  }(name='EnvChangeDetail'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
}

model CreateAppEnvResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreateAppEnvResponseBody(name='body'),
}

async function createAppEnv(request: CreateAppEnvRequest): CreateAppEnvResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createAppEnvWithOptions(request, headers, runtime);
}

async function createAppEnvWithOptions(request: CreateAppEnvRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateAppEnvResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }

  var body : map[string]any = {};
  if (!Util.isUnset(request.appId)) {
    body['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.dryRun)) {
    body['DryRun'] = request.dryRun;
  }
  if (!Util.isUnset(request.envDescription)) {
    body['EnvDescription'] = request.envDescription;
  }
  if (!Util.isUnset(request.envName)) {
    body['EnvName'] = request.envName;
  }
  if (!Util.isUnset(request.extraProperties)) {
    body['ExtraProperties'] = request.extraProperties;
  }
  if (!Util.isUnset(request.optionSettings)) {
    body['OptionSettings'] = request.optionSettings;
  }
  if (!Util.isUnset(request.pkgVersionId)) {
    body['PkgVersionId'] = request.pkgVersionId;
  }
  if (!Util.isUnset(request.profileName)) {
    body['ProfileName'] = request.profileName;
  }
  if (!Util.isUnset(request.sourceEnvId)) {
    body['SourceEnvId'] = request.sourceEnvId;
  }
  if (!Util.isUnset(request.stackId)) {
    body['StackId'] = request.stackId;
  }
  if (!Util.isUnset(request.templateId)) {
    body['TemplateId'] = request.templateId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateAppEnv',
    version = '2019-03-20',
    protocol = 'HTTPS',
    pathname = `/pop/v1/wam/appEnv`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

model CreateApplicationRequest {
  appDescription?: string(name='AppDescription'),
  appName?: string(name='AppName'),
  categoryName?: string(name='CategoryName'),
  regionId?: string(name='RegionId'),
  usingSharedStorage?: boolean(name='UsingSharedStorage'),
}

model CreateApplicationResponseBody = {
  application?: {
    appDescription?: string(name='AppDescription'),
    appId?: string(name='AppId'),
    appName?: string(name='AppName'),
    categoryName?: string(name='CategoryName'),
    createTime?: long(name='CreateTime'),
    createUsername?: string(name='CreateUsername'),
    updateTime?: long(name='UpdateTime'),
    updateUsername?: string(name='UpdateUsername'),
    usingSharedStorage?: boolean(name='UsingSharedStorage'),
  }(name='Application'),
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
}

model CreateApplicationResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreateApplicationResponseBody(name='body'),
}

async function createApplication(request: CreateApplicationRequest): CreateApplicationResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createApplicationWithOptions(request, headers, runtime);
}

async function createApplicationWithOptions(request: CreateApplicationRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateApplicationResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }

  var body : map[string]any = {};
  if (!Util.isUnset(request.appDescription)) {
    body['AppDescription'] = request.appDescription;
  }
  if (!Util.isUnset(request.appName)) {
    body['AppName'] = request.appName;
  }
  if (!Util.isUnset(request.categoryName)) {
    body['CategoryName'] = request.categoryName;
  }
  if (!Util.isUnset(request.usingSharedStorage)) {
    body['UsingSharedStorage'] = request.usingSharedStorage;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateApplication',
    version = '2019-03-20',
    protocol = 'HTTPS',
    pathname = `/pop/v1/wam/application`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

model CreateConfigTemplateRequest {
  appId?: string(name='AppId'),
  optionSettings?: string(name='OptionSettings'),
  pkgVersionId?: string(name='PkgVersionId'),
  profileName?: string(name='ProfileName'),
  regionId?: string(name='RegionId'),
  sourceEnvId?: string(name='SourceEnvId'),
  sourceTemplateId?: string(name='SourceTemplateId'),
  stackId?: string(name='StackId'),
  templateDescription?: string(name='TemplateDescription'),
  templateName?: string(name='TemplateName'),
}

model CreateConfigTemplateResponseBody = {
  code?: string(name='Code'),
  configTemplate?: {
    appId?: string(name='AppId'),
    appName?: string(name='AppName'),
    createTime?: long(name='CreateTime'),
    pkgVersionId?: string(name='PkgVersionId'),
    pkgVersionLabel?: string(name='PkgVersionLabel'),
    stackId?: string(name='StackId'),
    stackName?: string(name='StackName'),
    templateDescription?: string(name='TemplateDescription'),
    templateId?: string(name='TemplateId'),
    templateName?: string(name='TemplateName'),
    templateType?: string(name='TemplateType'),
    updateTime?: long(name='UpdateTime'),
  }(name='ConfigTemplate'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
}

model CreateConfigTemplateResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreateConfigTemplateResponseBody(name='body'),
}

async function createConfigTemplate(request: CreateConfigTemplateRequest): CreateConfigTemplateResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createConfigTemplateWithOptions(request, headers, runtime);
}

async function createConfigTemplateWithOptions(request: CreateConfigTemplateRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateConfigTemplateResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }

  var body : map[string]any = {};
  if (!Util.isUnset(request.appId)) {
    body['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.optionSettings)) {
    body['OptionSettings'] = request.optionSettings;
  }
  if (!Util.isUnset(request.pkgVersionId)) {
    body['PkgVersionId'] = request.pkgVersionId;
  }
  if (!Util.isUnset(request.profileName)) {
    body['ProfileName'] = request.profileName;
  }
  if (!Util.isUnset(request.sourceEnvId)) {
    body['SourceEnvId'] = request.sourceEnvId;
  }
  if (!Util.isUnset(request.sourceTemplateId)) {
    body['SourceTemplateId'] = request.sourceTemplateId;
  }
  if (!Util.isUnset(request.stackId)) {
    body['StackId'] = request.stackId;
  }
  if (!Util.isUnset(request.templateDescription)) {
    body['TemplateDescription'] = request.templateDescription;
  }
  if (!Util.isUnset(request.templateName)) {
    body['TemplateName'] = request.templateName;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateConfigTemplate',
    version = '2019-03-20',
    protocol = 'HTTPS',
    pathname = `/pop/v1/wam/configTemplate`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

model CreateOrderRequest {
  productName?: string(name='ProductName'),
  regionId?: string(name='RegionId'),
}

model CreateOrderResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  orderDetail?: {
    code?: string(name='Code'),
    data?: string(name='Data'),
    message?: string(name='Message'),
    requestId?: string(name='RequestId'),
    success?: boolean(name='Success'),
  }(name='OrderDetail'),
  requestId?: string(name='RequestId'),
}

model CreateOrderResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreateOrderResponseBody(name='body'),
}

async function createOrder(request: CreateOrderRequest): CreateOrderResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createOrderWithOptions(request, headers, runtime);
}

async function createOrderWithOptions(request: CreateOrderRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateOrderResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }

  var body : map[string]any = {};
  if (!Util.isUnset(request.productName)) {
    body['ProductName'] = request.productName;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateOrder',
    version = '2019-03-20',
    protocol = 'HTTPS',
    pathname = `/pop/v1/paas/createOrder`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

model CreatePkgVersionRequest {
  appId?: string(name='AppId'),
  packageSource?: string(name='PackageSource'),
  pkgVersionDescription?: string(name='PkgVersionDescription'),
  pkgVersionLabel?: string(name='PkgVersionLabel'),
  regionId?: string(name='RegionId'),
}

model CreatePkgVersionResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  pkgVersion?: {
    appId?: string(name='AppId'),
    appName?: string(name='AppName'),
    createTime?: long(name='CreateTime'),
    packageSource?: string(name='PackageSource'),
    pkgVersionDescription?: string(name='PkgVersionDescription'),
    pkgVersionId?: string(name='PkgVersionId'),
    pkgVersionLabel?: string(name='PkgVersionLabel'),
    updateTime?: long(name='UpdateTime'),
  }(name='PkgVersion'),
  requestId?: string(name='RequestId'),
}

model CreatePkgVersionResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreatePkgVersionResponseBody(name='body'),
}

async function createPkgVersion(request: CreatePkgVersionRequest): CreatePkgVersionResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createPkgVersionWithOptions(request, headers, runtime);
}

async function createPkgVersionWithOptions(request: CreatePkgVersionRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreatePkgVersionResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }

  var body : map[string]any = {};
  if (!Util.isUnset(request.appId)) {
    body['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.packageSource)) {
    body['PackageSource'] = request.packageSource;
  }
  if (!Util.isUnset(request.pkgVersionDescription)) {
    body['PkgVersionDescription'] = request.pkgVersionDescription;
  }
  if (!Util.isUnset(request.pkgVersionLabel)) {
    body['PkgVersionLabel'] = request.pkgVersionLabel;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreatePkgVersion',
    version = '2019-03-20',
    protocol = 'HTTPS',
    pathname = `/pop/v1/wam/pkgVersion`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

model CreateStorageRequest {
  regionId?: string(name='RegionId'),
}

model CreateStorageResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  storage?: {
    bucketName?: string(name='BucketName'),
    createTime?: long(name='CreateTime'),
    updateTime?: long(name='UpdateTime'),
  }(name='Storage'),
}

model CreateStorageResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreateStorageResponseBody(name='body'),
}

async function createStorage(request: CreateStorageRequest): CreateStorageResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createStorageWithOptions(request, headers, runtime);
}

async function createStorageWithOptions(request: CreateStorageRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateStorageResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateStorage',
    version = '2019-03-20',
    protocol = 'HTTPS',
    pathname = `/pop/v1/wam/storage`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

model DeleteAppEnvRequest {
  envId?: string(name='EnvId'),
  regionId?: string(name='RegionId'),
}

model DeleteAppEnvResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
}

model DeleteAppEnvResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteAppEnvResponseBody(name='body'),
}

async function deleteAppEnv(request: DeleteAppEnvRequest): DeleteAppEnvResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteAppEnvWithOptions(request, headers, runtime);
}

async function deleteAppEnvWithOptions(request: DeleteAppEnvRequest, headers: map[string]string, runtime: Util.RuntimeOptions): DeleteAppEnvResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.envId)) {
    query['EnvId'] = request.envId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteAppEnv',
    version = '2019-03-20',
    protocol = 'HTTPS',
    pathname = `/pop/v1/wam/appEnv`,
    method = 'DELETE',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

model DeleteApplicationRequest {
  appId?: string(name='AppId'),
  regionId?: string(name='RegionId'),
}

model DeleteApplicationResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
}

model DeleteApplicationResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteApplicationResponseBody(name='body'),
}

async function deleteApplication(request: DeleteApplicationRequest): DeleteApplicationResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteApplicationWithOptions(request, headers, runtime);
}

async function deleteApplicationWithOptions(request: DeleteApplicationRequest, headers: map[string]string, runtime: Util.RuntimeOptions): DeleteApplicationResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteApplication',
    version = '2019-03-20',
    protocol = 'HTTPS',
    pathname = `/pop/v1/wam/application`,
    method = 'DELETE',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

model DeleteChangeRequest {
  changeId?: string(name='ChangeId'),
  regionId?: string(name='RegionId'),
}

model DeleteChangeResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
}

model DeleteChangeResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteChangeResponseBody(name='body'),
}

async function deleteChange(request: DeleteChangeRequest): DeleteChangeResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteChangeWithOptions(request, headers, runtime);
}

async function deleteChangeWithOptions(request: DeleteChangeRequest, headers: map[string]string, runtime: Util.RuntimeOptions): DeleteChangeResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.changeId)) {
    query['ChangeId'] = request.changeId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteChange',
    version = '2019-03-20',
    protocol = 'HTTPS',
    pathname = `/pop/v1/wam/change`,
    method = 'DELETE',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

model DeleteConfigTemplateRequest {
  regionId?: string(name='RegionId'),
  templateId?: string(name='TemplateId'),
}

model DeleteConfigTemplateResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
}

model DeleteConfigTemplateResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteConfigTemplateResponseBody(name='body'),
}

async function deleteConfigTemplate(request: DeleteConfigTemplateRequest): DeleteConfigTemplateResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteConfigTemplateWithOptions(request, headers, runtime);
}

async function deleteConfigTemplateWithOptions(request: DeleteConfigTemplateRequest, headers: map[string]string, runtime: Util.RuntimeOptions): DeleteConfigTemplateResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.templateId)) {
    query['TemplateId'] = request.templateId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteConfigTemplate',
    version = '2019-03-20',
    protocol = 'HTTPS',
    pathname = `/pop/v1/wam/configTemplate`,
    method = 'DELETE',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

model DeletePkgVersionRequest {
  pkgVersionId?: string(name='PkgVersionId'),
  regionId?: string(name='RegionId'),
}

model DeletePkgVersionResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
}

model DeletePkgVersionResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeletePkgVersionResponseBody(name='body'),
}

async function deletePkgVersion(request: DeletePkgVersionRequest): DeletePkgVersionResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return deletePkgVersionWithOptions(request, headers, runtime);
}

async function deletePkgVersionWithOptions(request: DeletePkgVersionRequest, headers: map[string]string, runtime: Util.RuntimeOptions): DeletePkgVersionResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.pkgVersionId)) {
    query['PkgVersionId'] = request.pkgVersionId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeletePkgVersion',
    version = '2019-03-20',
    protocol = 'HTTPS',
    pathname = `/pop/v1/wam/pkgVersion`,
    method = 'DELETE',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

model DeployAppEnvRequest {
  batchInterval?: int32(name='BatchInterval'),
  batchPercent?: int32(name='BatchPercent'),
  batchSize?: int32(name='BatchSize'),
  envId?: string(name='EnvId'),
  pauseBetweenBatches?: boolean(name='PauseBetweenBatches'),
  pkgVersionId?: string(name='PkgVersionId'),
  regionId?: string(name='RegionId'),
}

model DeployAppEnvResponseBody = {
  code?: string(name='Code'),
  envChange?: {
    changeId?: string(name='ChangeId'),
    envId?: string(name='EnvId'),
    startTime?: string(name='StartTime'),
  }(name='EnvChange'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
}

model DeployAppEnvResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeployAppEnvResponseBody(name='body'),
}

async function deployAppEnv(request: DeployAppEnvRequest): DeployAppEnvResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return deployAppEnvWithOptions(request, headers, runtime);
}

async function deployAppEnvWithOptions(request: DeployAppEnvRequest, headers: map[string]string, runtime: Util.RuntimeOptions): DeployAppEnvResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }

  var body : map[string]any = {};
  if (!Util.isUnset(request.batchInterval)) {
    body['BatchInterval'] = request.batchInterval;
  }
  if (!Util.isUnset(request.batchPercent)) {
    body['BatchPercent'] = request.batchPercent;
  }
  if (!Util.isUnset(request.batchSize)) {
    body['BatchSize'] = request.batchSize;
  }
  if (!Util.isUnset(request.envId)) {
    body['EnvId'] = request.envId;
  }
  if (!Util.isUnset(request.pauseBetweenBatches)) {
    body['PauseBetweenBatches'] = request.pauseBetweenBatches;
  }
  if (!Util.isUnset(request.pkgVersionId)) {
    body['PkgVersionId'] = request.pkgVersionId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DeployAppEnv',
    version = '2019-03-20',
    protocol = 'HTTPS',
    pathname = `/pop/v1/wam/appEnv/deploy`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

model DescribeAppEnvInstanceHealthRequest {
  envId?: string(name='EnvId'),
  regionId?: string(name='RegionId'),
}

model DescribeAppEnvInstanceHealthResponseBody = {
  code?: string(name='Code'),
  envInstanceHealth?: {
    enableHealthCheck?: boolean(name='EnableHealthCheck'),
    envId?: string(name='EnvId'),
    envName?: string(name='EnvName'),
    instanceHealthList?: {
      instanceHealth?: [ 
      {
        agentStatus?: string(name='AgentStatus'),
        appStatus?: string(name='AppStatus'),
        disconnectedTime?: string(name='DisconnectedTime'),
        instanceId?: string(name='InstanceId'),
      }
    ](name='InstanceHealth')
    }(name='InstanceHealthList'),
  }(name='EnvInstanceHealth'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
}

model DescribeAppEnvInstanceHealthResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeAppEnvInstanceHealthResponseBody(name='body'),
}

async function describeAppEnvInstanceHealth(request: DescribeAppEnvInstanceHealthRequest): DescribeAppEnvInstanceHealthResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return describeAppEnvInstanceHealthWithOptions(request, headers, runtime);
}

async function describeAppEnvInstanceHealthWithOptions(request: DescribeAppEnvInstanceHealthRequest, headers: map[string]string, runtime: Util.RuntimeOptions): DescribeAppEnvInstanceHealthResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.envId)) {
    query['EnvId'] = request.envId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeAppEnvInstanceHealth',
    version = '2019-03-20',
    protocol = 'HTTPS',
    pathname = `/pop/v1/wam/appEnv/instanceHealth`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

model DescribeAppEnvStatusRequest {
  envId?: string(name='EnvId'),
  regionId?: string(name='RegionId'),
}

model DescribeAppEnvStatusResponseBody = {
  code?: string(name='Code'),
  envStatus?: {
    abortingChange?: boolean(name='AbortingChange'),
    applyingChange?: boolean(name='ApplyingChange'),
    changeBanner?: string(name='ChangeBanner'),
    envId?: string(name='EnvId'),
    envName?: string(name='EnvName'),
    envStatus?: string(name='EnvStatus'),
    instanceAgentStatus?: {
      connectedInstances?: int32(name='ConnectedInstances'),
      disconnectedInstances?: int32(name='DisconnectedInstances'),
    }(name='InstanceAgentStatus'),
    instanceAppStatus?: {
      healthyInstances?: int32(name='HealthyInstances'),
      stoppedInstances?: int32(name='StoppedInstances'),
      unhealthyInstances?: int32(name='UnhealthyInstances'),
      unknownInstances?: int32(name='UnknownInstances'),
    }(name='InstanceAppStatus'),
    lastEnvStatus?: string(name='LastEnvStatus'),
    latestChangeId?: string(name='LatestChangeId'),
  }(name='EnvStatus'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
}

model DescribeAppEnvStatusResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeAppEnvStatusResponseBody(name='body'),
}

async function describeAppEnvStatus(request: DescribeAppEnvStatusRequest): DescribeAppEnvStatusResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return describeAppEnvStatusWithOptions(request, headers, runtime);
}

async function describeAppEnvStatusWithOptions(request: DescribeAppEnvStatusRequest, headers: map[string]string, runtime: Util.RuntimeOptions): DescribeAppEnvStatusResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.envId)) {
    query['EnvId'] = request.envId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeAppEnvStatus',
    version = '2019-03-20',
    protocol = 'HTTPS',
    pathname = `/pop/v1/wam/appEnv/status`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

model DescribeAppEnvsRequest {
  appId?: string(name='AppId'),
  envId?: string(name='EnvId'),
  envName?: string(name='EnvName'),
  envSearch?: string(name='EnvSearch'),
  includeTerminated?: boolean(name='IncludeTerminated'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  recentUpdated?: boolean(name='RecentUpdated'),
  regionId?: string(name='RegionId'),
  stackSearch?: string(name='StackSearch'),
}

model DescribeAppEnvsResponseBody = {
  appEnvs?: {
    appEnv?: [ 
    {
      abortingChange?: boolean(name='AbortingChange'),
      appId?: string(name='AppId'),
      appName?: string(name='AppName'),
      applyingChange?: boolean(name='ApplyingChange'),
      categoryName?: string(name='CategoryName'),
      changeBanner?: string(name='ChangeBanner'),
      createTime?: long(name='CreateTime'),
      createUsername?: string(name='CreateUsername'),
      dataRoot?: string(name='DataRoot'),
      envDescription?: string(name='EnvDescription'),
      envId?: string(name='EnvId'),
      envName?: string(name='EnvName'),
      envStatus?: string(name='EnvStatus'),
      envType?: string(name='EnvType'),
      lastEnvStatus?: string(name='LastEnvStatus'),
      latestChangeId?: string(name='LatestChangeId'),
      logBase?: string(name='LogBase'),
      pkgVersionId?: string(name='PkgVersionId'),
      pkgVersionLabel?: string(name='PkgVersionLabel'),
      pkgVersionStorageKey?: string(name='PkgVersionStorageKey'),
      stackId?: string(name='StackId'),
      stackName?: string(name='StackName'),
      storageBase?: string(name='StorageBase'),
      totalInstances?: long(name='TotalInstances'),
      updateTime?: long(name='UpdateTime'),
      updateUsername?: string(name='UpdateUsername'),
      usingSharedStorage?: boolean(name='UsingSharedStorage'),
    }
  ](name='AppEnv')
  }(name='AppEnvs'),
  code?: string(name='Code'),
  message?: string(name='Message'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  requestId?: string(name='RequestId'),
  totalCount?: int32(name='TotalCount'),
}

model DescribeAppEnvsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeAppEnvsResponseBody(name='body'),
}

async function describeAppEnvs(request: DescribeAppEnvsRequest): DescribeAppEnvsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return describeAppEnvsWithOptions(request, headers, runtime);
}

async function describeAppEnvsWithOptions(request: DescribeAppEnvsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): DescribeAppEnvsResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.envId)) {
    query['EnvId'] = request.envId;
  }
  if (!Util.isUnset(request.envName)) {
    query['EnvName'] = request.envName;
  }
  if (!Util.isUnset(request.envSearch)) {
    query['EnvSearch'] = request.envSearch;
  }
  if (!Util.isUnset(request.includeTerminated)) {
    query['IncludeTerminated'] = request.includeTerminated;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.recentUpdated)) {
    query['RecentUpdated'] = request.recentUpdated;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.stackSearch)) {
    query['StackSearch'] = request.stackSearch;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeAppEnvs',
    version = '2019-03-20',
    protocol = 'HTTPS',
    pathname = `/pop/v1/wam/appEnv`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

model DescribeApplicationsRequest {
  appId?: string(name='AppId'),
  appName?: string(name='AppName'),
  appSearch?: string(name='AppSearch'),
  categorySearch?: string(name='CategorySearch'),
  envSearch?: string(name='EnvSearch'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  regionId?: string(name='RegionId'),
  stackSearch?: string(name='StackSearch'),
}

model DescribeApplicationsResponseBody = {
  applications?: {
    application?: [ 
    {
      appDescription?: string(name='AppDescription'),
      appId?: string(name='AppId'),
      appName?: string(name='AppName'),
      categoryName?: string(name='CategoryName'),
      createTime?: long(name='CreateTime'),
      createUsername?: string(name='CreateUsername'),
      runningEnvs?: int32(name='RunningEnvs'),
      terminatedEnvs?: int32(name='TerminatedEnvs'),
      totalEnvs?: int32(name='TotalEnvs'),
      updateTime?: long(name='UpdateTime'),
      updateUsername?: string(name='UpdateUsername'),
      usingSharedStorage?: string(name='UsingSharedStorage'),
    }
  ](name='Application')
  }(name='Applications'),
  code?: string(name='Code'),
  message?: string(name='Message'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  requestId?: string(name='RequestId'),
  totalCount?: int32(name='TotalCount'),
}

model DescribeApplicationsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeApplicationsResponseBody(name='body'),
}

async function describeApplications(request: DescribeApplicationsRequest): DescribeApplicationsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return describeApplicationsWithOptions(request, headers, runtime);
}

async function describeApplicationsWithOptions(request: DescribeApplicationsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): DescribeApplicationsResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.appName)) {
    query['AppName'] = request.appName;
  }
  if (!Util.isUnset(request.appSearch)) {
    query['AppSearch'] = request.appSearch;
  }
  if (!Util.isUnset(request.categorySearch)) {
    query['CategorySearch'] = request.categorySearch;
  }
  if (!Util.isUnset(request.envSearch)) {
    query['EnvSearch'] = request.envSearch;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.stackSearch)) {
    query['StackSearch'] = request.stackSearch;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeApplications',
    version = '2019-03-20',
    protocol = 'HTTPS',
    pathname = `/pop/v1/wam/application`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

model DescribeCategoriesRequest {
  regionId?: string(name='RegionId'),
}

model DescribeCategoriesResponseBody = {
  categories?: {
    category?: [ 
    {
      categoryDescription?: string(name='CategoryDescription'),
      categoryId?: string(name='CategoryId'),
      categoryLogo?: string(name='CategoryLogo'),
      categoryName?: string(name='CategoryName'),
      createTime?: string(name='CreateTime'),
      demoProjects?: {
        demoProject?: [ 
        {
          packageDownloadUrl?: string(name='PackageDownloadUrl'),
          packageUrl?: string(name='PackageUrl'),
          regionId?: string(name='RegionId'),
          sourceUrl?: string(name='SourceUrl'),
        }
      ](name='DemoProject')
      }(name='DemoProjects'),
      updateTime?: string(name='UpdateTime'),
    }
  ](name='Category')
  }(name='Categories'),
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
}

model DescribeCategoriesResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeCategoriesResponseBody(name='body'),
}

async function describeCategories(request: DescribeCategoriesRequest): DescribeCategoriesResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return describeCategoriesWithOptions(request, headers, runtime);
}

async function describeCategoriesWithOptions(request: DescribeCategoriesRequest, headers: map[string]string, runtime: Util.RuntimeOptions): DescribeCategoriesResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeCategories',
    version = '2019-03-20',
    protocol = 'HTTPS',
    pathname = `/pop/v1/wam/category`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

model DescribeChangeRequest {
  changeId?: string(name='ChangeId'),
  envId?: string(name='EnvId'),
  regionId?: string(name='RegionId'),
}

model DescribeChangeResponseBody = {
  change?: {
    actionName?: string(name='ActionName'),
    changeAborted?: boolean(name='ChangeAborted'),
    changeDescription?: string(name='ChangeDescription'),
    changeFinished?: boolean(name='ChangeFinished'),
    changeId?: string(name='ChangeId'),
    changeMessage?: string(name='ChangeMessage'),
    changeName?: string(name='ChangeName'),
    changePaused?: boolean(name='ChangePaused'),
    changeSucceed?: boolean(name='ChangeSucceed'),
    changeTimedout?: boolean(name='ChangeTimedout'),
    createTime?: long(name='CreateTime'),
    createUsername?: string(name='CreateUsername'),
    envId?: string(name='EnvId'),
    finishTime?: long(name='FinishTime'),
    updateTime?: long(name='UpdateTime'),
  }(name='Change'),
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
}

model DescribeChangeResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeChangeResponseBody(name='body'),
}

async function describeChange(request: DescribeChangeRequest): DescribeChangeResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return describeChangeWithOptions(request, headers, runtime);
}

async function describeChangeWithOptions(request: DescribeChangeRequest, headers: map[string]string, runtime: Util.RuntimeOptions): DescribeChangeResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.changeId)) {
    query['ChangeId'] = request.changeId;
  }
  if (!Util.isUnset(request.envId)) {
    query['EnvId'] = request.envId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeChange',
    version = '2019-03-20',
    protocol = 'HTTPS',
    pathname = `/pop/v1/wam/changeInfo`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

model DescribeChangesRequest {
  actionName?: string(name='ActionName'),
  envId?: string(name='EnvId'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  regionId?: string(name='RegionId'),
}

model DescribeChangesResponseBody = {
  changes?: {
    change?: [ 
    {
      actionName?: string(name='ActionName'),
      changeAborted?: boolean(name='ChangeAborted'),
      changeDescription?: string(name='ChangeDescription'),
      changeFinished?: boolean(name='ChangeFinished'),
      changeId?: string(name='ChangeId'),
      changeMessage?: string(name='ChangeMessage'),
      changeName?: string(name='ChangeName'),
      changePaused?: boolean(name='ChangePaused'),
      changeSucceed?: boolean(name='ChangeSucceed'),
      changeTimedout?: boolean(name='ChangeTimedout'),
      createTime?: long(name='CreateTime'),
      createUsername?: string(name='CreateUsername'),
      envId?: string(name='EnvId'),
      finishTime?: long(name='FinishTime'),
      updateTime?: long(name='UpdateTime'),
    }
  ](name='Change')
  }(name='Changes'),
  code?: string(name='Code'),
  message?: string(name='Message'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  requestId?: string(name='RequestId'),
  totalCount?: int32(name='TotalCount'),
}

model DescribeChangesResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeChangesResponseBody(name='body'),
}

async function describeChanges(request: DescribeChangesRequest): DescribeChangesResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return describeChangesWithOptions(request, headers, runtime);
}

async function describeChangesWithOptions(request: DescribeChangesRequest, headers: map[string]string, runtime: Util.RuntimeOptions): DescribeChangesResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.actionName)) {
    query['ActionName'] = request.actionName;
  }
  if (!Util.isUnset(request.envId)) {
    query['EnvId'] = request.envId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeChanges',
    version = '2019-03-20',
    protocol = 'HTTPS',
    pathname = `/pop/v1/wam/change`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

model DescribeConfigIndexRequest {
  envId?: string(name='EnvId'),
  profileName?: string(name='ProfileName'),
  regionId?: string(name='RegionId'),
  stackId?: string(name='StackId'),
  templateId?: string(name='TemplateId'),
}

model DescribeConfigIndexResponseBody = {
  code?: string(name='Code'),
  configGroups?: {
    configGroup?: [ 
    {
      configPaths?: {
        configPath?: [ 
        {
          configOptions?: {
            configOption?: [ 
            {
              changeSeverity?: string(name='ChangeSeverity'),
              defaultValue?: string(name='DefaultValue'),
              editorType?: string(name='EditorType'),
              hiddenOption?: boolean(name='HiddenOption'),
              maxLength?: int32(name='MaxLength'),
              maxValue?: long(name='MaxValue'),
              minLength?: int32(name='MinLength'),
              minValue?: long(name='MinValue'),
              optionDescription?: string(name='OptionDescription'),
              optionLabel?: string(name='OptionLabel'),
              optionName?: string(name='OptionName'),
              pathName?: string(name='PathName'),
              readonlyOption?: boolean(name='ReadonlyOption'),
              regexDesc?: string(name='RegexDesc'),
              regexPattern?: string(name='RegexPattern'),
              valueOptions?: string(name='ValueOptions'),
              valueType?: string(name='ValueType'),
            }
          ](name='ConfigOption')
          }(name='ConfigOptions'),
          hiddenPath?: boolean(name='HiddenPath'),
          pathLabel?: string(name='PathLabel'),
          pathName?: string(name='PathName'),
        }
      ](name='ConfigPath')
      }(name='ConfigPaths'),
      groupLabel?: string(name='GroupLabel'),
      groupName?: string(name='GroupName'),
    }
  ](name='ConfigGroup')
  }(name='ConfigGroups'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  stackId?: string(name='StackId'),
  stackName?: string(name='StackName'),
}

model DescribeConfigIndexResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeConfigIndexResponseBody(name='body'),
}

async function describeConfigIndex(request: DescribeConfigIndexRequest): DescribeConfigIndexResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return describeConfigIndexWithOptions(request, headers, runtime);
}

async function describeConfigIndexWithOptions(request: DescribeConfigIndexRequest, headers: map[string]string, runtime: Util.RuntimeOptions): DescribeConfigIndexResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.envId)) {
    query['EnvId'] = request.envId;
  }
  if (!Util.isUnset(request.profileName)) {
    query['ProfileName'] = request.profileName;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.stackId)) {
    query['StackId'] = request.stackId;
  }
  if (!Util.isUnset(request.templateId)) {
    query['TemplateId'] = request.templateId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeConfigIndex',
    version = '2019-03-20',
    protocol = 'HTTPS',
    pathname = `/pop/v1/wam/config/configIndex`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

model DescribeConfigOptionsRequest {
  envId?: string(name='EnvId'),
  profileName?: string(name='ProfileName'),
  regionId?: string(name='RegionId'),
  stackId?: string(name='StackId'),
}

model DescribeConfigOptionsResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  stackConfigOption?: {
    configOptions?: {
      configOption?: [ 
      {
        changeSeverity?: string(name='ChangeSeverity'),
        defaultValue?: string(name='DefaultValue'),
        editorType?: string(name='EditorType'),
        hiddenOption?: boolean(name='HiddenOption'),
        maxLength?: int32(name='MaxLength'),
        maxValue?: long(name='MaxValue'),
        minLength?: int32(name='MinLength'),
        minValue?: long(name='MinValue'),
        optionDescription?: string(name='OptionDescription'),
        optionLabel?: string(name='OptionLabel'),
        optionName?: string(name='OptionName'),
        pathName?: string(name='PathName'),
        readonlyOption?: boolean(name='ReadonlyOption'),
        regexDesc?: string(name='RegexDesc'),
        regexPattern?: string(name='RegexPattern'),
        valueOptions?: string(name='ValueOptions'),
        valueType?: string(name='ValueType'),
      }
    ](name='ConfigOption')
    }(name='ConfigOptions'),
    stackId?: string(name='StackId'),
    stackName?: string(name='StackName'),
  }(name='StackConfigOption'),
}

model DescribeConfigOptionsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeConfigOptionsResponseBody(name='body'),
}

async function describeConfigOptions(request: DescribeConfigOptionsRequest): DescribeConfigOptionsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return describeConfigOptionsWithOptions(request, headers, runtime);
}

async function describeConfigOptionsWithOptions(request: DescribeConfigOptionsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): DescribeConfigOptionsResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.envId)) {
    query['EnvId'] = request.envId;
  }
  if (!Util.isUnset(request.profileName)) {
    query['ProfileName'] = request.profileName;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.stackId)) {
    query['StackId'] = request.stackId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeConfigOptions',
    version = '2019-03-20',
    protocol = 'HTTPS',
    pathname = `/pop/v1/wam/config/configOption`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

model DescribeConfigSettingsRequest {
  envId?: string(name='EnvId'),
  optionName?: string(name='OptionName'),
  pathName?: string(name='PathName'),
  regionId?: string(name='RegionId'),
  templateId?: string(name='TemplateId'),
}

model DescribeConfigSettingsResponseBody = {
  code?: string(name='Code'),
  configSettings?: {
    configSetting?: [ 
    {
      optionName?: string(name='OptionName'),
      pathName?: string(name='PathName'),
      settingValue?: string(name='SettingValue'),
    }
  ](name='ConfigSetting')
  }(name='ConfigSettings'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
}

model DescribeConfigSettingsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeConfigSettingsResponseBody(name='body'),
}

async function describeConfigSettings(request: DescribeConfigSettingsRequest): DescribeConfigSettingsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return describeConfigSettingsWithOptions(request, headers, runtime);
}

async function describeConfigSettingsWithOptions(request: DescribeConfigSettingsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): DescribeConfigSettingsResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.envId)) {
    query['EnvId'] = request.envId;
  }
  if (!Util.isUnset(request.optionName)) {
    query['OptionName'] = request.optionName;
  }
  if (!Util.isUnset(request.pathName)) {
    query['PathName'] = request.pathName;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.templateId)) {
    query['TemplateId'] = request.templateId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeConfigSettings',
    version = '2019-03-20',
    protocol = 'HTTPS',
    pathname = `/pop/v1/wam/config/configSetting`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

model DescribeConfigTemplatesRequest {
  appId?: string(name='AppId'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  regionId?: string(name='RegionId'),
  templateName?: string(name='TemplateName'),
  templateSearch?: string(name='TemplateSearch'),
}

model DescribeConfigTemplatesResponseBody = {
  code?: string(name='Code'),
  configTemplates?: {
    configTemplate?: [ 
    {
      appId?: string(name='AppId'),
      appName?: string(name='AppName'),
      createTime?: long(name='CreateTime'),
      pkgVersionId?: string(name='PkgVersionId'),
      pkgVersionLabel?: string(name='PkgVersionLabel'),
      stackId?: string(name='StackId'),
      stackName?: string(name='StackName'),
      templateDescription?: string(name='TemplateDescription'),
      templateId?: string(name='TemplateId'),
      templateName?: string(name='TemplateName'),
      updateTime?: long(name='UpdateTime'),
    }
  ](name='ConfigTemplate')
  }(name='ConfigTemplates'),
  message?: string(name='Message'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  requestId?: string(name='RequestId'),
  totalCount?: int32(name='TotalCount'),
}

model DescribeConfigTemplatesResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeConfigTemplatesResponseBody(name='body'),
}

async function describeConfigTemplates(request: DescribeConfigTemplatesRequest): DescribeConfigTemplatesResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return describeConfigTemplatesWithOptions(request, headers, runtime);
}

async function describeConfigTemplatesWithOptions(request: DescribeConfigTemplatesRequest, headers: map[string]string, runtime: Util.RuntimeOptions): DescribeConfigTemplatesResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.templateName)) {
    query['TemplateName'] = request.templateName;
  }
  if (!Util.isUnset(request.templateSearch)) {
    query['TemplateSearch'] = request.templateSearch;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeConfigTemplates',
    version = '2019-03-20',
    protocol = 'HTTPS',
    pathname = `/pop/v1/wam/configTemplate`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

model DescribeEnvResourceRequest {
  envId?: string(name='EnvId'),
  regionId?: string(name='RegionId'),
}

model DescribeEnvResourceResponseBody = {
  code?: string(name='Code'),
  envResource?: {
    defaultSecurityGroups?: {
      securityGroup?: [ 
      {
        id?: string(name='Id'),
      }
    ](name='SecurityGroup')
    }(name='DefaultSecurityGroups'),
    domains?: {
      domain?: [ 
      {
        domainName?: string(name='DomainName'),
        hostedBy?: string(name='HostedBy'),
        isDefault?: boolean(name='IsDefault'),
        managedBy?: string(name='ManagedBy'),
        subDomain?: string(name='SubDomain'),
      }
    ](name='Domain')
    }(name='Domains'),
    envId?: string(name='EnvId'),
    envName?: string(name='EnvName'),
    instances?: {
      instance?: [ 
      {
        id?: string(name='Id'),
        imported?: boolean(name='Imported'),
      }
    ](name='Instance')
    }(name='Instances'),
    launchConfigurationId?: string(name='LaunchConfigurationId'),
    launchTemplateId?: string(name='LaunchTemplateId'),
    loadBalancers?: {
      loadBalancer?: [ 
      {
        addressType?: string(name='AddressType'),
        id?: string(name='Id'),
        imported?: boolean(name='Imported'),
        listeners?: {
          listener?: [ 
          {
            port?: int32(name='Port'),
            protocol?: string(name='Protocol'),
          }
        ](name='Listener')
        }(name='Listeners'),
        port?: int32(name='Port'),
        protocol?: string(name='Protocol'),
      }
    ](name='LoadBalancer')
    }(name='LoadBalancers'),
    monitorGroup?: {
      id?: string(name='Id'),
    }(name='MonitorGroup'),
    rdsInstances?: {
      rdsInstance?: [ 
      {
        accountName?: string(name='AccountName'),
        databaseName?: string(name='DatabaseName'),
        id?: string(name='Id'),
        imported?: boolean(name='Imported'),
      }
    ](name='RdsInstance')
    }(name='RdsInstances'),
    scalingGroup?: {
      id?: string(name='Id'),
    }(name='ScalingGroup'),
    vSwitches?: {
      vSwitch?: [ 
      {
        id?: string(name='Id'),
      }
    ](name='VSwitch')
    }(name='VSwitches'),
    vpc?: {
      id?: string(name='Id'),
    }(name='Vpc'),
  }(name='EnvResource'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
}

model DescribeEnvResourceResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeEnvResourceResponseBody(name='body'),
}

async function describeEnvResource(request: DescribeEnvResourceRequest): DescribeEnvResourceResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return describeEnvResourceWithOptions(request, headers, runtime);
}

async function describeEnvResourceWithOptions(request: DescribeEnvResourceRequest, headers: map[string]string, runtime: Util.RuntimeOptions): DescribeEnvResourceResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.envId)) {
    query['EnvId'] = request.envId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeEnvResource',
    version = '2019-03-20',
    protocol = 'HTTPS',
    pathname = `/pop/v1/wam/envResource`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

model DescribeEventsRequest {
  changeId?: string(name='ChangeId'),
  endTime?: long(name='EndTime'),
  envId?: string(name='EnvId'),
  lastChangeEvents?: boolean(name='LastChangeEvents'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  regionId?: string(name='RegionId'),
  reverseByTimestamp?: boolean(name='ReverseByTimestamp'),
  startTime?: long(name='StartTime'),
}

model DescribeEventsResponseBody = {
  code?: string(name='Code'),
  events?: {
    event?: [ 
    {
      appId?: string(name='AppId'),
      envId?: string(name='EnvId'),
      enventName?: string(name='EnventName'),
      eventId?: string(name='EventId'),
      eventLevel?: string(name='EventLevel'),
      eventMessage?: string(name='EventMessage'),
      eventTimestamp?: long(name='EventTimestamp'),
      msgCode?: string(name='MsgCode'),
      msgParams?: {
        msgParam?: [ string ](name='MsgParam')
      }(name='MsgParams'),
      objectAttrs?: {
        objectAttr?: [ 
        {
          attributeName?: string(name='AttributeName'),
          attributeValue?: string(name='AttributeValue'),
        }
      ](name='ObjectAttr')
      }(name='ObjectAttrs'),
      objectId?: string(name='ObjectId'),
      objectName?: string(name='ObjectName'),
      objectType?: string(name='ObjectType'),
      primaryUserId?: string(name='PrimaryUserId'),
      primaryUserName?: string(name='PrimaryUserName'),
      secondUserId?: string(name='SecondUserId'),
      secondUserName?: string(name='SecondUserName'),
      traceId?: string(name='TraceId'),
    }
  ](name='Event')
  }(name='Events'),
  message?: string(name='Message'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  requestId?: string(name='RequestId'),
  totalCount?: int32(name='TotalCount'),
}

model DescribeEventsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeEventsResponseBody(name='body'),
}

async function describeEvents(request: DescribeEventsRequest): DescribeEventsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return describeEventsWithOptions(request, headers, runtime);
}

async function describeEventsWithOptions(request: DescribeEventsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): DescribeEventsResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.changeId)) {
    query['ChangeId'] = request.changeId;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.envId)) {
    query['EnvId'] = request.envId;
  }
  if (!Util.isUnset(request.lastChangeEvents)) {
    query['LastChangeEvents'] = request.lastChangeEvents;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.reverseByTimestamp)) {
    query['ReverseByTimestamp'] = request.reverseByTimestamp;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeEvents',
    version = '2019-03-20',
    protocol = 'HTTPS',
    pathname = `/pop/v1/wam/event`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

model DescribeGatherLogResultRequest {
  changeId?: string(name='ChangeId'),
  regionId?: string(name='RegionId'),
}

model DescribeGatherLogResultResponseBody = {
  code?: string(name='Code'),
  gatherLogResult?: {
    change?: {
      actionName?: string(name='ActionName'),
      changeAborted?: boolean(name='ChangeAborted'),
      changeDescription?: string(name='ChangeDescription'),
      changeFinished?: boolean(name='ChangeFinished'),
      changeId?: string(name='ChangeId'),
      changeMessage?: string(name='ChangeMessage'),
      changeName?: string(name='ChangeName'),
      changePaused?: boolean(name='ChangePaused'),
      changeSucceeded?: boolean(name='ChangeSucceeded'),
      changeTimedout?: boolean(name='ChangeTimedout'),
      createTime?: long(name='CreateTime'),
      createUsername?: string(name='CreateUsername'),
      envId?: string(name='EnvId'),
      finishTime?: long(name='FinishTime'),
      updateTime?: long(name='UpdateTime'),
    }(name='Change'),
    instanceResults?: {
      instanceResult?: [ 
      {
        instanceId?: string(name='InstanceId'),
        storageKey?: string(name='StorageKey'),
        taskMessage?: string(name='TaskMessage'),
        taskSucceeded?: boolean(name='TaskSucceeded'),
      }
    ](name='InstanceResult')
    }(name='InstanceResults'),
    logPath?: string(name='LogPath'),
  }(name='GatherLogResult'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
}

model DescribeGatherLogResultResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeGatherLogResultResponseBody(name='body'),
}

async function describeGatherLogResult(request: DescribeGatherLogResultRequest): DescribeGatherLogResultResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return describeGatherLogResultWithOptions(request, headers, runtime);
}

async function describeGatherLogResultWithOptions(request: DescribeGatherLogResultRequest, headers: map[string]string, runtime: Util.RuntimeOptions): DescribeGatherLogResultResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.changeId)) {
    query['ChangeId'] = request.changeId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeGatherLogResult',
    version = '2019-03-20',
    protocol = 'HTTPS',
    pathname = `/pop/v1/wam/appEnv/gatherLog`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

model DescribeGatherStatsResultRequest {
  changeId?: string(name='ChangeId'),
  regionId?: string(name='RegionId'),
}

model DescribeGatherStatsResultResponseBody = {
  code?: string(name='Code'),
  gatherStatsResult?: {
    change?: {
      actionName?: string(name='ActionName'),
      changeAborted?: boolean(name='ChangeAborted'),
      changeDescription?: string(name='ChangeDescription'),
      changeFinished?: boolean(name='ChangeFinished'),
      changeId?: string(name='ChangeId'),
      changeMessage?: string(name='ChangeMessage'),
      changeName?: string(name='ChangeName'),
      changePaused?: boolean(name='ChangePaused'),
      changeSucceeded?: boolean(name='ChangeSucceeded'),
      changeTimedout?: boolean(name='ChangeTimedout'),
      createTime?: long(name='CreateTime'),
      createUsername?: string(name='CreateUsername'),
      envId?: string(name='EnvId'),
      finishTime?: long(name='FinishTime'),
      updateTime?: long(name='UpdateTime'),
    }(name='Change'),
    instanceResults?: {
      instanceResult?: [ 
      {
        instanceId?: string(name='InstanceId'),
        storageKey?: string(name='StorageKey'),
        taskMessage?: string(name='TaskMessage'),
        taskSucceeded?: boolean(name='TaskSucceeded'),
      }
    ](name='InstanceResult')
    }(name='InstanceResults'),
  }(name='GatherStatsResult'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
}

model DescribeGatherStatsResultResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeGatherStatsResultResponseBody(name='body'),
}

async function describeGatherStatsResult(request: DescribeGatherStatsResultRequest): DescribeGatherStatsResultResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return describeGatherStatsResultWithOptions(request, headers, runtime);
}

async function describeGatherStatsResultWithOptions(request: DescribeGatherStatsResultRequest, headers: map[string]string, runtime: Util.RuntimeOptions): DescribeGatherStatsResultResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.changeId)) {
    query['ChangeId'] = request.changeId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeGatherStatsResult',
    version = '2019-03-20',
    protocol = 'HTTPS',
    pathname = `/pop/v1/wam/appEnv/gatherStats`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

model DescribeInstanceHealthRequest {
  instanceId?: string(name='InstanceId'),
  regionId?: string(name='RegionId'),
}

model DescribeInstanceHealthResponseBody = {
  code?: string(name='Code'),
  instanceHealth?: {
    agentStatus?: string(name='AgentStatus'),
    appStatus?: string(name='AppStatus'),
    disconnectedTime?: long(name='DisconnectedTime'),
    instanceId?: string(name='InstanceId'),
  }(name='InstanceHealth'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
}

model DescribeInstanceHealthResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeInstanceHealthResponseBody(name='body'),
}

async function describeInstanceHealth(request: DescribeInstanceHealthRequest): DescribeInstanceHealthResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return describeInstanceHealthWithOptions(request, headers, runtime);
}

async function describeInstanceHealthWithOptions(request: DescribeInstanceHealthRequest, headers: map[string]string, runtime: Util.RuntimeOptions): DescribeInstanceHealthResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeInstanceHealth',
    version = '2019-03-20',
    protocol = 'HTTPS',
    pathname = `/pop/v1/wam/instance/health`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

model DescribePkgVersionsRequest {
  appId?: string(name='AppId'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  pkgVersionLabel?: string(name='PkgVersionLabel'),
  pkgVersionSearch?: string(name='PkgVersionSearch'),
  regionId?: string(name='RegionId'),
}

model DescribePkgVersionsResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  pkgVersions?: {
    pkgVersion?: [ 
    {
      appId?: string(name='AppId'),
      appName?: string(name='AppName'),
      createTime?: long(name='CreateTime'),
      createUsername?: string(name='CreateUsername'),
      packageETag?: string(name='PackageETag'),
      packageSource?: string(name='PackageSource'),
      pkgVersionDescription?: string(name='PkgVersionDescription'),
      pkgVersionId?: string(name='PkgVersionId'),
      pkgVersionLabel?: string(name='PkgVersionLabel'),
      updateTime?: long(name='UpdateTime'),
    }
  ](name='PkgVersion')
  }(name='PkgVersions'),
  requestId?: string(name='RequestId'),
  totalCount?: int32(name='TotalCount'),
}

model DescribePkgVersionsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribePkgVersionsResponseBody(name='body'),
}

async function describePkgVersions(request: DescribePkgVersionsRequest): DescribePkgVersionsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return describePkgVersionsWithOptions(request, headers, runtime);
}

async function describePkgVersionsWithOptions(request: DescribePkgVersionsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): DescribePkgVersionsResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.pkgVersionLabel)) {
    query['PkgVersionLabel'] = request.pkgVersionLabel;
  }
  if (!Util.isUnset(request.pkgVersionSearch)) {
    query['PkgVersionSearch'] = request.pkgVersionSearch;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribePkgVersions',
    version = '2019-03-20',
    protocol = 'HTTPS',
    pathname = `/pop/v1/wam/pkgVersion`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

model DescribePublicConfigTemplatesRequest {
  categoryName?: string(name='CategoryName'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  regionId?: string(name='RegionId'),
}

model DescribePublicConfigTemplatesResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  publicConfigTemplates?: {
    publicConfigTemplate?: [ 
    {
      categoryName?: string(name='CategoryName'),
      createTime?: long(name='CreateTime'),
      packageSource?: string(name='PackageSource'),
      stackId?: string(name='StackId'),
      stackName?: string(name='StackName'),
      templateDescription?: string(name='TemplateDescription'),
      templateId?: string(name='TemplateId'),
      templateLogo?: string(name='TemplateLogo'),
      templateName?: string(name='TemplateName'),
      updateTime?: long(name='UpdateTime'),
    }
  ](name='PublicConfigTemplate')
  }(name='PublicConfigTemplates'),
  requestId?: string(name='RequestId'),
  totalCount?: int32(name='TotalCount'),
}

model DescribePublicConfigTemplatesResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribePublicConfigTemplatesResponseBody(name='body'),
}

async function describePublicConfigTemplates(request: DescribePublicConfigTemplatesRequest): DescribePublicConfigTemplatesResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return describePublicConfigTemplatesWithOptions(request, headers, runtime);
}

async function describePublicConfigTemplatesWithOptions(request: DescribePublicConfigTemplatesRequest, headers: map[string]string, runtime: Util.RuntimeOptions): DescribePublicConfigTemplatesResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.categoryName)) {
    query['CategoryName'] = request.categoryName;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribePublicConfigTemplates',
    version = '2019-03-20',
    protocol = 'HTTPS',
    pathname = `/pop/v1/wam/publicConfigTemplate`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

model DescribeStacksRequest {
  categoryName?: string(name='CategoryName'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  recommendedOnly?: boolean(name='RecommendedOnly'),
  regionId?: string(name='RegionId'),
}

model DescribeStacksResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  requestId?: string(name='RequestId'),
  stacks?: {
    stack?: [ 
    {
      categoryName?: string(name='CategoryName'),
      createTime?: long(name='CreateTime'),
      latestStack?: boolean(name='LatestStack'),
      recommendedStack?: boolean(name='RecommendedStack'),
      stackId?: string(name='StackId'),
      stackName?: string(name='StackName'),
      updateTime?: long(name='UpdateTime'),
      versionCode?: int32(name='VersionCode'),
    }
  ](name='Stack')
  }(name='Stacks'),
  totalCount?: int32(name='TotalCount'),
}

model DescribeStacksResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeStacksResponseBody(name='body'),
}

async function describeStacks(request: DescribeStacksRequest): DescribeStacksResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return describeStacksWithOptions(request, headers, runtime);
}

async function describeStacksWithOptions(request: DescribeStacksRequest, headers: map[string]string, runtime: Util.RuntimeOptions): DescribeStacksResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.categoryName)) {
    query['CategoryName'] = request.categoryName;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.recommendedOnly)) {
    query['RecommendedOnly'] = request.recommendedOnly;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeStacks',
    version = '2019-03-20',
    protocol = 'HTTPS',
    pathname = `/pop/v1/wam/stack`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

model DescribeStorageRequest {
  regionId?: string(name='RegionId'),
  usingSharedStorage?: boolean(name='UsingSharedStorage'),
}

model DescribeStorageResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  storage?: {
    bucketName?: string(name='BucketName'),
    createTime?: long(name='CreateTime'),
    keyPrefix?: string(name='KeyPrefix'),
    pkgKeyPrefix?: string(name='PkgKeyPrefix'),
    updateTime?: long(name='UpdateTime'),
  }(name='Storage'),
}

model DescribeStorageResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeStorageResponseBody(name='body'),
}

async function describeStorage(request: DescribeStorageRequest): DescribeStorageResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return describeStorageWithOptions(request, headers, runtime);
}

async function describeStorageWithOptions(request: DescribeStorageRequest, headers: map[string]string, runtime: Util.RuntimeOptions): DescribeStorageResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.usingSharedStorage)) {
    query['UsingSharedStorage'] = request.usingSharedStorage;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeStorage',
    version = '2019-03-20',
    protocol = 'HTTPS',
    pathname = `/pop/v1/wam/storage`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

model GatherAppEnvLogRequest {
  envId?: string(name='EnvId'),
  logPath?: string(name='LogPath'),
  regionId?: string(name='RegionId'),
  targetInstances?: string(name='TargetInstances'),
}

model GatherAppEnvLogResponseBody = {
  code?: string(name='Code'),
  envChange?: {
    changeId?: string(name='ChangeId'),
    envId?: string(name='EnvId'),
    startTime?: string(name='StartTime'),
  }(name='EnvChange'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
}

model GatherAppEnvLogResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GatherAppEnvLogResponseBody(name='body'),
}

async function gatherAppEnvLog(request: GatherAppEnvLogRequest): GatherAppEnvLogResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return gatherAppEnvLogWithOptions(request, headers, runtime);
}

async function gatherAppEnvLogWithOptions(request: GatherAppEnvLogRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GatherAppEnvLogResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }

  var body : map[string]any = {};
  if (!Util.isUnset(request.envId)) {
    body['EnvId'] = request.envId;
  }
  if (!Util.isUnset(request.logPath)) {
    body['LogPath'] = request.logPath;
  }
  if (!Util.isUnset(request.targetInstances)) {
    body['TargetInstances'] = request.targetInstances;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GatherAppEnvLog',
    version = '2019-03-20',
    protocol = 'HTTPS',
    pathname = `/pop/v1/wam/appEnv/gatherLog`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

model GatherAppEnvStatsRequest {
  envId?: string(name='EnvId'),
  regionId?: string(name='RegionId'),
  targetInstances?: string(name='TargetInstances'),
}

model GatherAppEnvStatsResponseBody = {
  code?: string(name='Code'),
  envChange?: {
    changeId?: string(name='ChangeId'),
    envId?: string(name='EnvId'),
    startTime?: string(name='StartTime'),
  }(name='EnvChange'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
}

model GatherAppEnvStatsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GatherAppEnvStatsResponseBody(name='body'),
}

async function gatherAppEnvStats(request: GatherAppEnvStatsRequest): GatherAppEnvStatsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return gatherAppEnvStatsWithOptions(request, headers, runtime);
}

async function gatherAppEnvStatsWithOptions(request: GatherAppEnvStatsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GatherAppEnvStatsResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }

  var body : map[string]any = {};
  if (!Util.isUnset(request.envId)) {
    body['EnvId'] = request.envId;
  }
  if (!Util.isUnset(request.targetInstances)) {
    body['TargetInstances'] = request.targetInstances;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GatherAppEnvStats',
    version = '2019-03-20',
    protocol = 'HTTPS',
    pathname = `/pop/v1/wam/appEnv/gatherStats`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

model PauseChangeRequest {
  changeId?: string(name='ChangeId'),
  regionId?: string(name='RegionId'),
}

model PauseChangeResponseBody = {
  code?: string(name='Code'),
  envChange?: {
    changeId?: string(name='ChangeId'),
    envId?: string(name='EnvId'),
    startTime?: string(name='StartTime'),
  }(name='EnvChange'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
}

model PauseChangeResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: PauseChangeResponseBody(name='body'),
}

async function pauseChange(request: PauseChangeRequest): PauseChangeResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return pauseChangeWithOptions(request, headers, runtime);
}

async function pauseChangeWithOptions(request: PauseChangeRequest, headers: map[string]string, runtime: Util.RuntimeOptions): PauseChangeResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }

  var body : map[string]any = {};
  if (!Util.isUnset(request.changeId)) {
    body['ChangeId'] = request.changeId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'PauseChange',
    version = '2019-03-20',
    protocol = 'HTTPS',
    pathname = `/pop/v1/wam/change/pause`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

model RebuildAppEnvRequest {
  dryRun?: boolean(name='DryRun'),
  envId?: string(name='EnvId'),
  regionId?: string(name='RegionId'),
}

model RebuildAppEnvResponseBody = {
  code?: string(name='Code'),
  envChangeDetail?: {
    changeId?: string(name='ChangeId'),
    envId?: string(name='EnvId'),
    operations?: {
      operation?: [ 
      {
        operationDescription?: string(name='OperationDescription'),
        operationType?: string(name='OperationType'),
      }
    ](name='Operation')
    }(name='Operations'),
    startTime?: string(name='StartTime'),
  }(name='EnvChangeDetail'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
}

model RebuildAppEnvResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: RebuildAppEnvResponseBody(name='body'),
}

async function rebuildAppEnv(request: RebuildAppEnvRequest): RebuildAppEnvResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return rebuildAppEnvWithOptions(request, headers, runtime);
}

async function rebuildAppEnvWithOptions(request: RebuildAppEnvRequest, headers: map[string]string, runtime: Util.RuntimeOptions): RebuildAppEnvResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }

  var body : map[string]any = {};
  if (!Util.isUnset(request.dryRun)) {
    body['DryRun'] = request.dryRun;
  }
  if (!Util.isUnset(request.envId)) {
    body['EnvId'] = request.envId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'RebuildAppEnv',
    version = '2019-03-20',
    protocol = 'HTTPS',
    pathname = `/pop/v1/wam/appEnv/rebuild`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

model RestartAppEnvRequest {
  batchInterval?: int32(name='BatchInterval'),
  batchPercent?: int32(name='BatchPercent'),
  batchSize?: int32(name='BatchSize'),
  envId?: string(name='EnvId'),
  pauseBetweenBatches?: boolean(name='PauseBetweenBatches'),
  regionId?: string(name='RegionId'),
}

model RestartAppEnvResponseBody = {
  code?: string(name='Code'),
  envChange?: {
    changeId?: string(name='ChangeId'),
    envId?: string(name='EnvId'),
    startTime?: string(name='StartTime'),
  }(name='EnvChange'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
}

model RestartAppEnvResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: RestartAppEnvResponseBody(name='body'),
}

async function restartAppEnv(request: RestartAppEnvRequest): RestartAppEnvResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return restartAppEnvWithOptions(request, headers, runtime);
}

async function restartAppEnvWithOptions(request: RestartAppEnvRequest, headers: map[string]string, runtime: Util.RuntimeOptions): RestartAppEnvResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }

  var body : map[string]any = {};
  if (!Util.isUnset(request.batchInterval)) {
    body['BatchInterval'] = request.batchInterval;
  }
  if (!Util.isUnset(request.batchPercent)) {
    body['BatchPercent'] = request.batchPercent;
  }
  if (!Util.isUnset(request.batchSize)) {
    body['BatchSize'] = request.batchSize;
  }
  if (!Util.isUnset(request.envId)) {
    body['EnvId'] = request.envId;
  }
  if (!Util.isUnset(request.pauseBetweenBatches)) {
    body['PauseBetweenBatches'] = request.pauseBetweenBatches;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'RestartAppEnv',
    version = '2019-03-20',
    protocol = 'HTTPS',
    pathname = `/pop/v1/wam/appEnv/restart`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

model ResumeChangeRequest {
  changeId?: string(name='ChangeId'),
  regionId?: string(name='RegionId'),
}

model ResumeChangeResponseBody = {
  code?: string(name='Code'),
  envChange?: {
    changeId?: string(name='ChangeId'),
    envId?: string(name='EnvId'),
    startTime?: string(name='StartTime'),
  }(name='EnvChange'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
}

model ResumeChangeResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ResumeChangeResponseBody(name='body'),
}

async function resumeChange(request: ResumeChangeRequest): ResumeChangeResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return resumeChangeWithOptions(request, headers, runtime);
}

async function resumeChangeWithOptions(request: ResumeChangeRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ResumeChangeResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }

  var body : map[string]any = {};
  if (!Util.isUnset(request.changeId)) {
    body['ChangeId'] = request.changeId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ResumeChange',
    version = '2019-03-20',
    protocol = 'HTTPS',
    pathname = `/pop/v1/wam/change/resume`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

model StartAppEnvRequest {
  envId?: string(name='EnvId'),
  regionId?: string(name='RegionId'),
}

model StartAppEnvResponseBody = {
  code?: string(name='Code'),
  envChange?: {
    changeId?: string(name='ChangeId'),
    envId?: string(name='EnvId'),
    startTime?: string(name='StartTime'),
  }(name='EnvChange'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
}

model StartAppEnvResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: StartAppEnvResponseBody(name='body'),
}

async function startAppEnv(request: StartAppEnvRequest): StartAppEnvResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return startAppEnvWithOptions(request, headers, runtime);
}

async function startAppEnvWithOptions(request: StartAppEnvRequest, headers: map[string]string, runtime: Util.RuntimeOptions): StartAppEnvResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }

  var body : map[string]any = {};
  if (!Util.isUnset(request.envId)) {
    body['EnvId'] = request.envId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'StartAppEnv',
    version = '2019-03-20',
    protocol = 'HTTPS',
    pathname = `/pop/v1/wam/appEnv/start`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

model StopAppEnvRequest {
  envId?: string(name='EnvId'),
  regionId?: string(name='RegionId'),
}

model StopAppEnvResponseBody = {
  code?: string(name='Code'),
  envChange?: {
    changeId?: string(name='ChangeId'),
    envId?: string(name='EnvId'),
    startTime?: string(name='StartTime'),
  }(name='EnvChange'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
}

model StopAppEnvResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: StopAppEnvResponseBody(name='body'),
}

async function stopAppEnv(request: StopAppEnvRequest): StopAppEnvResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return stopAppEnvWithOptions(request, headers, runtime);
}

async function stopAppEnvWithOptions(request: StopAppEnvRequest, headers: map[string]string, runtime: Util.RuntimeOptions): StopAppEnvResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }

  var body : map[string]any = {};
  if (!Util.isUnset(request.envId)) {
    body['EnvId'] = request.envId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'StopAppEnv',
    version = '2019-03-20',
    protocol = 'HTTPS',
    pathname = `/pop/v1/wam/appEnv/stop`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

model TerminateAppEnvRequest {
  dryRun?: string(name='DryRun'),
  envId?: string(name='EnvId'),
  regionId?: string(name='RegionId'),
}

model TerminateAppEnvResponseBody = {
  code?: string(name='Code'),
  envChangeDetail?: {
    changeId?: string(name='ChangeId'),
    envId?: string(name='EnvId'),
    operations?: {
      operation?: [ 
      {
        operationDescription?: string(name='OperationDescription'),
        operationType?: string(name='OperationType'),
      }
    ](name='Operation')
    }(name='Operations'),
    startTime?: string(name='StartTime'),
  }(name='EnvChangeDetail'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
}

model TerminateAppEnvResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: TerminateAppEnvResponseBody(name='body'),
}

async function terminateAppEnv(request: TerminateAppEnvRequest): TerminateAppEnvResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return terminateAppEnvWithOptions(request, headers, runtime);
}

async function terminateAppEnvWithOptions(request: TerminateAppEnvRequest, headers: map[string]string, runtime: Util.RuntimeOptions): TerminateAppEnvResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }

  var body : map[string]any = {};
  if (!Util.isUnset(request.dryRun)) {
    body['DryRun'] = request.dryRun;
  }
  if (!Util.isUnset(request.envId)) {
    body['EnvId'] = request.envId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'TerminateAppEnv',
    version = '2019-03-20',
    protocol = 'HTTPS',
    pathname = `/pop/v1/wam/appEnv/terminate`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

model UpdateAppEnvRequest {
  batchInterval?: string(name='BatchInterval'),
  batchPercent?: string(name='BatchPercent'),
  batchSize?: string(name='BatchSize'),
  dryRun?: boolean(name='DryRun'),
  envDescription?: string(name='EnvDescription'),
  envId?: string(name='EnvId'),
  extraProperties?: string(name='ExtraProperties'),
  optionSettings?: string(name='OptionSettings'),
  pauseBetweenBatches?: boolean(name='PauseBetweenBatches'),
  pkgVersionId?: string(name='PkgVersionId'),
  regionId?: string(name='RegionId'),
  stackId?: string(name='StackId'),
}

model UpdateAppEnvResponseBody = {
  code?: string(name='Code'),
  envChangeDetail?: {
    changeId?: string(name='ChangeId'),
    envId?: string(name='EnvId'),
    operations?: {
      operation?: [ 
      {
        operationDescription?: string(name='OperationDescription'),
        operationType?: string(name='OperationType'),
      }
    ](name='Operation')
    }(name='Operations'),
    startTime?: string(name='StartTime'),
  }(name='EnvChangeDetail'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
}

model UpdateAppEnvResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: UpdateAppEnvResponseBody(name='body'),
}

async function updateAppEnv(request: UpdateAppEnvRequest): UpdateAppEnvResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return updateAppEnvWithOptions(request, headers, runtime);
}

async function updateAppEnvWithOptions(request: UpdateAppEnvRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateAppEnvResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }

  var body : map[string]any = {};
  if (!Util.isUnset(request.batchInterval)) {
    body['BatchInterval'] = request.batchInterval;
  }
  if (!Util.isUnset(request.batchPercent)) {
    body['BatchPercent'] = request.batchPercent;
  }
  if (!Util.isUnset(request.batchSize)) {
    body['BatchSize'] = request.batchSize;
  }
  if (!Util.isUnset(request.dryRun)) {
    body['DryRun'] = request.dryRun;
  }
  if (!Util.isUnset(request.envDescription)) {
    body['EnvDescription'] = request.envDescription;
  }
  if (!Util.isUnset(request.envId)) {
    body['EnvId'] = request.envId;
  }
  if (!Util.isUnset(request.extraProperties)) {
    body['ExtraProperties'] = request.extraProperties;
  }
  if (!Util.isUnset(request.optionSettings)) {
    body['OptionSettings'] = request.optionSettings;
  }
  if (!Util.isUnset(request.pauseBetweenBatches)) {
    body['PauseBetweenBatches'] = request.pauseBetweenBatches;
  }
  if (!Util.isUnset(request.pkgVersionId)) {
    body['PkgVersionId'] = request.pkgVersionId;
  }
  if (!Util.isUnset(request.stackId)) {
    body['StackId'] = request.stackId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateAppEnv',
    version = '2019-03-20',
    protocol = 'HTTPS',
    pathname = `/pop/v1/wam/appEnv`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

model UpdateApplicationRequest {
  appDescription?: string(name='AppDescription'),
  appId?: string(name='AppId'),
  regionId?: string(name='RegionId'),
}

model UpdateApplicationResponseBody = {
  application?: {
    appDescription?: string(name='AppDescription'),
    appId?: string(name='AppId'),
    appName?: string(name='AppName'),
    categoryName?: string(name='CategoryName'),
    createTime?: long(name='CreateTime'),
    createUsername?: string(name='CreateUsername'),
    updateTime?: long(name='UpdateTime'),
    updateUsername?: string(name='UpdateUsername'),
  }(name='Application'),
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
}

model UpdateApplicationResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: UpdateApplicationResponseBody(name='body'),
}

async function updateApplication(request: UpdateApplicationRequest): UpdateApplicationResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return updateApplicationWithOptions(request, headers, runtime);
}

async function updateApplicationWithOptions(request: UpdateApplicationRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateApplicationResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }

  var body : map[string]any = {};
  if (!Util.isUnset(request.appDescription)) {
    body['AppDescription'] = request.appDescription;
  }
  if (!Util.isUnset(request.appId)) {
    body['AppId'] = request.appId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateApplication',
    version = '2019-03-20',
    protocol = 'HTTPS',
    pathname = `/pop/v1/wam/application`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

model UpdateConfigTemplateRequest {
  optionSettings?: string(name='OptionSettings'),
  regionId?: string(name='RegionId'),
  templateDescription?: string(name='TemplateDescription'),
  templateId?: string(name='TemplateId'),
}

model UpdateConfigTemplateResponseBody = {
  code?: string(name='Code'),
  configTemplate?: {
    appId?: string(name='AppId'),
    appName?: string(name='AppName'),
    createTime?: long(name='CreateTime'),
    stackId?: string(name='StackId'),
    stackName?: string(name='StackName'),
    templateId?: string(name='TemplateId'),
    templateName?: string(name='TemplateName'),
    updateTime?: long(name='UpdateTime'),
  }(name='ConfigTemplate'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
}

model UpdateConfigTemplateResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: UpdateConfigTemplateResponseBody(name='body'),
}

async function updateConfigTemplate(request: UpdateConfigTemplateRequest): UpdateConfigTemplateResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return updateConfigTemplateWithOptions(request, headers, runtime);
}

async function updateConfigTemplateWithOptions(request: UpdateConfigTemplateRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateConfigTemplateResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }

  var body : map[string]any = {};
  if (!Util.isUnset(request.optionSettings)) {
    body['OptionSettings'] = request.optionSettings;
  }
  if (!Util.isUnset(request.templateDescription)) {
    body['TemplateDescription'] = request.templateDescription;
  }
  if (!Util.isUnset(request.templateId)) {
    body['TemplateId'] = request.templateId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateConfigTemplate',
    version = '2019-03-20',
    protocol = 'HTTPS',
    pathname = `/pop/v1/wam/configTemplate`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

model ValidateConfigSettingRequest {
  envId?: string(name='EnvId'),
  optionSettings?: string(name='OptionSettings'),
  regionId?: string(name='RegionId'),
  stackId?: string(name='StackId'),
  templateId?: string(name='TemplateId'),
}

model ValidateConfigSettingResponseBody = {
  code?: string(name='Code'),
  configValidationResults?: {
    configValidationResult?: [ 
    {
      configOption?: {
        changeSeverity?: string(name='ChangeSeverity'),
        defaultValue?: string(name='DefaultValue'),
        editorType?: string(name='EditorType'),
        hiddenOption?: boolean(name='HiddenOption'),
        maxLength?: int32(name='MaxLength'),
        maxValue?: long(name='MaxValue'),
        minLength?: int32(name='MinLength'),
        minValue?: long(name='MinValue'),
        optionDescription?: string(name='OptionDescription'),
        optionLabel?: string(name='OptionLabel'),
        optionName?: string(name='OptionName'),
        pathName?: string(name='PathName'),
        readonlyOption?: boolean(name='ReadonlyOption'),
        regexDesc?: string(name='RegexDesc'),
        regexPattern?: string(name='RegexPattern'),
        valueOptions?: string(name='ValueOptions'),
        valueType?: string(name='ValueType'),
      }(name='ConfigOption'),
      optionName?: string(name='OptionName'),
      pathName?: string(name='PathName'),
      resultMessage?: string(name='ResultMessage'),
      resultSeverity?: string(name='ResultSeverity'),
    }
  ](name='ConfigValidationResult')
  }(name='ConfigValidationResults'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
}

model ValidateConfigSettingResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ValidateConfigSettingResponseBody(name='body'),
}

async function validateConfigSetting(request: ValidateConfigSettingRequest): ValidateConfigSettingResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return validateConfigSettingWithOptions(request, headers, runtime);
}

async function validateConfigSettingWithOptions(request: ValidateConfigSettingRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ValidateConfigSettingResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }

  var body : map[string]any = {};
  if (!Util.isUnset(request.envId)) {
    body['EnvId'] = request.envId;
  }
  if (!Util.isUnset(request.optionSettings)) {
    body['OptionSettings'] = request.optionSettings;
  }
  if (!Util.isUnset(request.stackId)) {
    body['StackId'] = request.stackId;
  }
  if (!Util.isUnset(request.templateId)) {
    body['TemplateId'] = request.templateId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ValidateConfigSetting',
    version = '2019-03-20',
    protocol = 'HTTPS',
    pathname = `/pop/v1/wam/config/configSetting/validate`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

